import VueRouter from 'vue-router'
import Vue from 'vue'
import routes1 from './routes1'
import routes2 from './routes2'

Vue.use(VueRouter)
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch(err => err)
}

const baseRoutes = []
const routes = baseRoutes.concat(routes1, routes2)
export default new VueRouter({
  mode: 'history',//去除访问路径“#”
  // mode: 'abstract',
  // mode: 'hash',
  routes,
  base: process.env.BASE_URL
})
